﻿using ContractWebApi.BtbContractEnum;

namespace ContractWebApi.Models.EventModel
{
    /// <summary>
    /// 认证结果回调参数 - 具体查询：https://docor.letsign.com/openapi/apidoc/message/
    /// </summary>
    public class AuthenticationResultInput
    {
        /// <summary>
        /// 1:个人；2：企业
        /// </summary>
        public CertTypeEnum CertType { get; set; }

        /// <summary>
        /// 页面版为urlCode, 接口版为verifyId
        /// </summary>
        public string TransactionCode { get; set; }

        /// <summary>
        /// 个人认证信息
        /// </summary>
        public Person Person { get; set; }

        /// <summary>
        /// 企业认证信息
        /// </summary>
        public Enterprise Enterprise { get; set; }
    }


    /// <summary>
    /// 个人认证信息
    /// </summary>
    public class Person : BaseResultInput
    {
        /// <summary>
        /// 个人认证唯一标识
        /// </summary>
        public string PersonOpenCode { get; set; }
    }

    /// <summary>
    /// 企业认证信息
    /// </summary>
    public class Enterprise : BaseResultInput
    {
        /// <summary>
        /// 企业认证唯一标识
        /// </summary>
        public string CompanyOpenCode { get; set; }

        /// <summary>
        /// 认证失败的理由
        /// </summary>
        public string ErrMsg { get; set; }

        /// <summary>
        /// 是否可以申请复核，申请后会再次推送平台审核消息
        /// </summary>
        public string CanApplyRecheck { get; set; }
    }

    /// <summary>
    /// 个人与企业认证共同参数
    /// </summary>
    public class BaseResultInput
    {
        /// <summary>
        /// 认证Id
        /// </summary>
        public string VerifyId { get; set; }

        /// <summary>
        /// 认证状态
        /// 0：认证失败
        /// 1：认证成功
        /// 2：认证未开始
        /// 3：认证进行中
        /// </summary>
        public CertStatusEnum CertStatus { get; set; }

        /// <summary>
        /// 绑定开放编码   是否需要
        /// </summary>
        public bool BindOpenCode { get; set; }
    }
}